<template>
  <div>detail</div>
</template>

<script>
import { onMounted, toRefs,reactive } from "vue";
import { useRouter } from "vue-router";
import axios from "axios";
export default {
  setup() {
    const state = reactive({
        detail:{}
    })
    const router = useRouter();
    // console.log(router);
    onMounted(() => {
    //   console.log(router.currentRoute.value.params);
      var {id} = router.currentRoute.value.params;
      axios.get(`http://122.112.161.135:4000/api/movieDetail?id=${id}`).then(res=>{
          console.log(res.data.res);
          state.detail = res.data.res
      })

    });
    const refState = toRefs(state);
    return {
        ...refState
    }
  },
};
</script>

<style>
</style>